define(["shareHeader", "sharePhoto", "shareFunction", "shareBottom", "hover"],
    function (shareHeader, sharePhoto, shareFunction, shareBottom, hover) {
        let _getTheNode = function (object) {
            return object.pointNode
        }
        /*单个分享对象*/
        function shareNode() {
            this.shareHeader = ''
            this.sharePhoto = ''
            this.shareFunction = ''
            this.shareBottom = ''
            this.widthOfPare = null
            this.hov = new hover()//放置出现弹出框事件
        }
        shareNode.prototype.setWidthOfPare = function (length) {
            this.widthOfPare = length
        }
        shareNode.prototype._setNode = function (data) {
            this.shareHeader = new shareHeader(data)
            this.sharePhoto = new sharePhoto(data)
            this.shareFunction = new shareFunction(data)
            this.shareBottom = new shareBottom(data)
            this.shareFunction.setID(data.shareId, data.author.userId)
        }
        shareNode.prototype.getOneNode = function (data) {
            this._setNode(data)
            let div = document.createElement("div")
            div.className = "cont-inner share"
            if (data.totalComment === 0) {
                div.appendChild(_getTheNode(this.shareHeader))
                div.appendChild(_getTheNode(this.sharePhoto))
                div.appendChild(_getTheNode(this.shareFunction))
                this.sharePhoto.setPhotoRoll(data, this.widthOfPare)
                this.shareFunction.transmitShare()
                this.hov.onHover(div, data.shareId, data.author.userId)
            }
            else {
                div.appendChild(_getTheNode(this.shareHeader))
                div.appendChild(_getTheNode(this.sharePhoto))
                div.appendChild(_getTheNode(this.shareFunction))
                div.appendChild(_getTheNode(this.shareBottom))
                this.sharePhoto.setPhotoRoll(data, this.widthOfPare)
                this.shareFunction.transmitShare()
                this.hov.onHover(div, data.shareId, data.author.userId)
            }
            return div
        }
        return shareNode
    })
